extends Card

func init():
	att.cry = 0
	lv = 4
	type = TYPE.MAGIC
	camp = "m_all"
	name = "Anlaer的礼物"
	dec = "随机将3费或以下的随从和法术各一张加入手牌，法术牌变为0费，随从牌+1/1。"
	tab = "群友"

func _use(card,cell):
	var chag = []
	var chas = sys.game.cardRndPool.items
	var cantplus = false
	chas.shuffle()
	for i in range(1):
		var card1 = sys.game.cardRndPool.rndItem(self,"rnd1")
		if card1 != null:
			var cha = getHero().newCard(card1.id)
			getHero().hand.addCard(cha)
			cha.att.cry = 0
			chag.append(cha)
	for i in range(1):
		var card1 = sys.game.cardRndPool.rndItem(self,"rnd2")
		if card1 != null:
			var cha = getHero().newCard(card1.id)
			getHero().hand.addCard(cha)
			cha.att.atk += 1
			cha.att.maxHp += 1
			chag.append(cha)

func rnd1(card:Card):
	if card.type == Card.TYPE.MAGIC && card.att.cry <= 3 && card != self:
		return true
	return false

func rnd2(card:Card):
	if card.type == Card.TYPE.CREATURE && card.att.cry <= 3 && card != self:
		return true
	return false